<template>
	<view>
		<button @click="onShowBtn">保险弹窗</button>
		<riding-risk-component-pop :visible="visible" onPopupClose="onPopupClose" onSuccess="onSuccess"
			onAdError="onAdError" onClose="onClose" ></riding-risk-component-pop>
	</view>
</template>

<script>
export default {
	data() {
		return {
			visible: true,
		}
	},
	onLoad() {
		this.$scope.onPopupClose = this.onPopupClose.bind(this)
		this.$scope.onSuccess = this.onSuccess.bind(this)
		this.$scope.onClose = this.onClose.bind(this)
		this.$scope.onAdError = this.onAdError.bind(this)
	},
	methods: {
		onShowBtn() {
			this.visible = true
		},
		onPopupClose() {
			this.visible = false
		},
		onSuccess() {
			console.log("加载成功")
		},
		onClose(err) {
			console.log(err, "广告关闭")
		},
		onAdError(err) {
			console.log(err, "加载失败")
		},
	}
}
</script>
